package com.evan.designpatterns.prototype.refactor;

import org.springframework.beans.BeanUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;

/**
 * @author :liujiapeng01
 * @date :2019-03-14 13:20
 **/
public class Test {
    public static void main(String[] args) throws InvocationTargetException, IllegalAccessException {

        // 浅克隆
        Student student = new Student();
        student.setAge(10);
        student.setName("45");
        student.setArray(Arrays.asList("1", "2"));

        Student student1 = new Student();
        BeanUtils.copyProperties(student, student1);
        System.out.println(student == student1);
        System.out.println(student.getAge() == student1.getAge());
        System.out.println(student.getName() == student1.getName());
        System.out.println(student.getArray() == student1.getArray());


    }
}
